package j2metris;

import javax.microedition.lcdui.Image;

public abstract class ControllablePiece
{
    /**
     * Unconditionally rotates this <code>ControllablePiece</code> clockwise. Should
     * not check for or attempt to handle obstructions.
     */
    public abstract void rotateClockwise();
    /**
     * Unconditionally rotates this <code>ControllablePiece</code> counterclockwise. Should
     * not check for or attempt to handle obstructions.
     */
    public abstract void rotateCounterclockwise();
    /**
     * Retrieves a set of <code>Coordinate</code>s that represent the spaces
     * that this <code>ControllablePiece</code> is filling within its own square of
     * existence. They are not relative to the entire playing field.
     * 
     * @return an array of<code>Coordinate</code>s representing the spaces that
     * this <code>ControllablePiece</code> is filling
     */
    public abstract Coordinate[] getRotationState();
    /**
     * Returns a set of <code>Coordinates</code> that represent the spaces
     * that this <code>ControllablePiece</code> would be filling if it were
     * <code>distanceFromCurrentState</code> rotations away from its current
     * state. A positive parameter represents clockwise rotations, while a
     * negative parameter represents counterclockwise rotations.
     *
     * @param distanceFromCurrentState the number of rotations away from the
     * <code>ControllablePiece</code>'s current state, positive for clockwise and negative
     * for counterclockwise
     * @return an array of <code>Coordinate</code>s representing the spaces that
     * this <code>ControllablePiece</code> would be filling if it were the specified
     * number of rotations away from its current state
     */
    public abstract Coordinate[] getRotationState(int distanceFromCurrentState);
    /**
     * Returns a copy of this <code>ControllablePiece</code>.
     * @return a copy of this <code>ControllablePiece</code>.
     */
    public abstract ControllablePiece clone();
    /**
     * Returns an <code>Image</code>that represents a single "block" of this
     * <code>ControllablePiece</code>. All of the seven traditional <code>ControllablePiece</code>es
     * have four such blocks.
     *
     * @return an <code>Image</code> that represents a single "block" of this
     * <code>ControllablePiece</code>
     */
    public abstract Image getUnitImage();
    /**
     * Returns a set of <code>Coordinate</code>s that represents all of this
     * <code>Piece</code>'s possible rotation states.
     * 
     * @return an array of all of this <code>Piece</code>'s possible rotation
     * states
     */
    public abstract Coordinate[][] getRotationStates();
}
